%%%%%
%%
%% This file creates the Item, ItemPacket, ItemFold, ItemEnvelope, and
%% ItemLabel datatypes, and creates macros for each.  These are for
%% various types of in-game items.
%%
%%%%%


%%%%%
%% Item macros are for normal item cards.
\DECLARESUBTYPE{Item}{TransElement}
\PRESETS{Item}{
  \FD\MYtext	{} %% longer text of item
  \FD\MYmark	{} %% possible contents of shaded ``mark'' on card
  \FD\MYbulky	{0} %% potential bulkiness
  \FD\MYcapacity{N/A} %% potential capacity
  \sd\MYlistmap	{\item\MYname\ifx\MYnumber\empty\else\ (\MYnumber)\fi}
  }


%%%%%
%% \prop
%% \unstash
%% \bulky{<number>}
%% \contain{<number>}
%%
%% \prop inside an Item macro labels the card as a prop.  \unstash
%% labels the card as unstashable.  \bulky{n} labels the card as
%% n-hands bulky.  \contain{n} labels the card with n-hands capacity.
\def\prop{%
  \append\MYmark{ ~PROP~ }}
\def\unstash{%
  \append\MYmark{ ~UNSTASHABLE~ }}
\def\bulky#1{%
  \s\MYbulky{#1}%
  \append\MYmark{\mbox{ ~\MYbulky-Hand~Bulky~ }}}
\def\contain#1{%
  \s\MYcapacity{#1}%
  \append\MYmark{\mbox{ ~\MYcapacity-Hand~Capacity~ }}}
\def\physrepped#{%
  \append\MYmark{ ~PHYSREPPED~ }}

%%%%%
%% Spark Components
\DECLARESUBTYPE{SparkItem}{Item}
\PRESETS{SparkItem}{
  \FD\MYnorth{}
  \FD\MYeast{}
  \FD\MYsouth{}
  \FD\MYwest{}
  }

%%%%%
%% Economy Item
\DECLARESUBTYPE{EconItem}{Item}

%%%%%
%% ItemPacket macros are for item cards with an attached packet.
%% They are a subtype of Item.
\DECLARESUBTYPE{ItemPacket}{Item}
\PRESETS{ItemPacket}{
  \F\MYcontents
  }


%%%%%
%% ItemFold macros are for items represented by just a folded packet.
%% They are a subtype of ItemPacket, with the longer text and ``mark''
%% left blank, since they have no actual item card.
\DECLARESUBTYPE{ItemFold}{ItemPacket}
\PRESETS{ItemFold}{
  \s\MYmark{}
  }


%%%%%
%% ItemEnvelope macros are for items represented by just an envelope.
%% They are a subtype of ItemPacket, with the longer text and ``mark''
%% left blank, since they have no actual item card.
\DECLARESUBTYPE{ItemEnvelope}{ItemPacket}
\PRESETS{ItemEnvelope}{
  \s\MYmark{}
  }


%%%%%
%% ItemLabel macros are for small labels that would get used on
%% physreps, e.g. gun labels.  The ``mark'' is left blank, since
%% it isn't used for these.
\DECLARESUBTYPE{ItemLabel}{Item}
\PRESETS{ItemLabel}{
  \s\MYmark{}
  }


%%%%%
%% \icard[<extras>]{<name>}{<number>}{<text>}
%% \specialicard[<extras>]{<name>}{<number>}{<text>}{<mark>}
%% \itempacket[<extras>]{<name>}{<number>}{<text>}{<mark>}{<contents>}
%% \itemfold{<name>}{<number>}{<text>}{<contents>}
%% \itemenvelope{<name>}{<number>}{<text>}{<contents>}
%% \itemlabel{<name>}{<number>}{<text>}
%%
%% These are wrappers around \INSTANCE, useful for 1-shots.
%%
%% For \icard, \specialicard, and \itempacket, the optional <extras>
%% (in []'s) is for things like \unstash and \bulky{3}.  For example,
%% \icard[\prop\contain{2}]{..}{..}{..}{..} gives an item that has a
%% prop and 3-hands capacity.
%%
%% The last arg (#5) to \specialicard is for anything extra you may
%% want in the ``mark''
\newinstance{Item}{\icard[4][]}{
  \s\MYname{#2}\s\MYnumber{#3}\s\MYtext{#4}#1}
\newinstance{Item}{\specialicard[5][]}{
  \s\MYname{#2}\s\MYnumber{#3}\s\MYtext{#4}\s\MYmark{#5}#1}
\newinstance{ItemPacket}{\itempacket[6][]}{
  \s\MYname{#2}\s\MYnumber{#3}\s\MYtext{#4}\s\MYmark{#5}\s\MYcontents{#6}#1}
\newinstance{ItemFold}{\itemfold[4]}{
  \s\MYname{#1}\s\MYnumber{#2}\s\MYtext{#3}\s\MYcontents{#4}}
\newinstance{ItemEnvelope}{\itemenvelope[4]}{
  \s\MYname{#1}\s\MYnumber{#2}\s\MYtext{#3}\s\MYcontents{#4}}
\newinstance{ItemLabel}{\itemlabel[3]}{
  \s\MYname{#1}\s\MYnumber{#2}\s\MYtext{#3}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\NEW{SparkItem}{\iSpark}{
  \s\MYname     {Spark Component}
  \s\MYnumber   {1234}
  \s\MYtext     {text text text text text text text text text text text text
                 text text text text text text text text text text text text
                 text text text text text text text text text text text text
                 text text text text text text text text text text text text
                 text text text text text text text text text text text text}
  \s\MYnorth    {North}
  \s\MYeast     {East}
  \s\MYsouth    {South}
  \s\MYwest     {West}
}

\NEW{SparkItem}{\iSparkTwo}{
  \s\MYname     {Spark Component Two}
  \s\MYnumber   {4321}
  \s\MYnorth    {N}
  \s\MYeast     {E}
  \s\MYsouth    {S}
  \s\MYwest     {W}
}

\NEW{SparkItem}{\iSparkThree}{
  \s\MYname     {Anode}
  \s\MYnumber   {1234}
  \s\MYtext     {When combined with a cathode, it's a power source.}
  \s\MYnorth    {Power}
  \s\MYsouth    {Other battery}
}

\NEW{SparkItem}{\iSparkFour}{
  \s\MYname     {Cathode}
  \s\MYnumber   {1234}
  \s\MYtext     {When combined with an anode, it's a power source.}
  \s\MYeast     {Other battery}
  \s\MYwest     {Power}
}

\NEW{SparkItem}{\iSparkLaser}{
  \s\MYname     {Laser}
  \s\MYnumber   {1234}
  \s\MYtext     {Red laser. Needs a power supply.}
  \s\MYsouth    {Red laser}
  \s\MYwest     {Power}
  \bulky{1}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%MACRO ECONOMY ITEMS.  THESE SHOULD ALL BE PRINTED OUT IN GREEN.

\NEW{EconItem}{\iMacroLabor}{
  \s\MYname	{Resource: Labor}
  \s\MYnumber	{3207}
  \s\MYtext	{A thousand laborers.\\ This item is non-transferable.}
}

\NEW{EconItem}{\iMacroParts}{
  \s\MYname	{Resource: Parts}
  \s\MYnumber	{3202}
  \s\MYtext	{100 tons of machine tools and parts.\\ This item is non-transferable.}
}

\NEW{EconItem}{\iMacroMaterials}{
  \s\MYname	{Resource: Materials}
  \s\MYnumber	{3204}
  \s\MYtext	{100 tons of steel, coal, and other useful materials.\\ This item is non-transferable.}
}

\NEW{EconItem}{\iMacroWeapons}{
  \s\MYname	{Resource: Weapons}
  \s\MYnumber	{3201}
  \s\MYtext	{100 tons of advanced weaponry and warmachines.\\ This item is non-transferable.}
}

\NEW{EconItem}{\iMacroImmortalium}{
  \s\MYname	{Resource: Unknown Mineral}
  \s\MYnumber	{3209}
  \s\MYtext	{1 kilogram of an orange glowing crystal with purple impurities.  If you wish to have your dock master deliver this crystal to the Castle, see a GM.\\ This item is non-transferable.}
}

\NEW{EconItem}{\iImmortalium}{
  \s\MYname	{Resource: Unknown Mineral}
  \s\MYnumber	{907}
  \s\MYtext	{1 kilogram of an orange glowing crystal with purple impurities.}
}

%Immortals Plot
\NEW{Item}{\iWidgetCM}{
  \s\MYname	{Widget}
  \s\MYnumber	{203}
  \s\MYtext	{A blinking device with the labels ``C'' and ``M''.}
}

\NEW{Item}{\iWidgetMR}{
  \s\MYname	{Widget}
  \s\MYnumber	{206}
  \s\MYtext	{A blinking device with the labels ``M'' and ``R''.}
}

\NEW{Item}{\iWidgetRT}{
  \s\MYname	{Widget}
  \s\MYnumber	{212}
  \s\MYtext	{A blinking device with the labels ``R'' and ``T''.}
}

\NEW{Item}{\iWidgetTC}{
  \s\MYname	{Widget}
  \s\MYnumber	{209}
  \s\MYtext	{A blinking device with the labels ``T'' and ``C''.}
}

\NEW{Item}{\iWidgetCMRT}{
  \s\MYname	{Widget}
  \s\MYnumber	{215}
  \s\MYtext	{A blinking device with the labels ``C'', ``M'', ``R'', and ``T''.}
}
